package com.unisci.android.utils;

import org.json.JSONObject;

public class HttpCmd {
	public static final int PCR_CMD_UNKNOW = -1;
	public static final int PCR_CMD_GET_VERSION = 0x01;
	public static final int PCR_CMD_GET_RUNCONF = 0x02;
	public static final int PCR_CMD_GET_STATUS = 0x03;
	public static final int PCR_CMD_SET_CONFIG = 0x11;
	public static final int PCR_CMD_SET_MODE = 0x12;
	public static final int PCR_CMD_RESET = 0x13;

	public static final int PCR_CMD_FAIL = 0xff;
	public static final int PCR_CMD_OK = 0x00;

	public static final int DIRECTION_INPUT = 0x01;
	public static final int DIRECTION_OUTPUT = 0x00;

	public int direction;
	public int cmd;
	public String uri;
	public JSONObject post;

	public HttpCmd() {

	}

	public HttpCmd(int dir, int cmd, String uri) {
		this.direction = dir;
		this.cmd = cmd;
		this.uri = uri;
	}

	public HttpCmd(int dir, int cmd, String uri, JSONObject post) {
		this.direction = dir;
		this.cmd = cmd;
		this.uri = uri;
		this.post = post;
	}

	public boolean isInput() {
		return (direction == DIRECTION_INPUT);
	}

	public boolean isOutput() {
		return (direction == DIRECTION_OUTPUT);
	}
}